load("@fbsource//tools/build_defs:rust_binary.bzl", "rust_binary")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("scm_server_infra")

rust_library(
    name = "context",
    srcs = glob(["src/**/*.rs"]),
    test_deps = ["//eden/mononoke/mononoke_macros:mononoke_macros"],
    deps = [
        "fbsource//third-party/rust:governor",
        "//common/rust/shed/fbinit:fbinit",
        "//eden/mononoke/common/async_limiter:async_limiter",
        "//eden/mononoke/common/metadata:metadata",
        "//eden/mononoke/common/rust/sql_ext/sql_query_telemetry:sql_query_telemetry",
        "//eden/mononoke/common/scribe_ext:scribe_ext",
        "//eden/mononoke/common/scuba_ext:scuba_ext",
        "//eden/mononoke/common/session_id:session_id",
        "//eden/mononoke/permission_checker:permission_checker",
        "//eden/mononoke/rate_limiting:rate_limiting",
        "//eden/scm/lib/clientinfo:clientinfo",
    ],
)

rust_binary(
    name = "benchmark",
    srcs = glob(["benchmark/**/*.rs"]),
    autocargo = {
        "cargo_target_config": {
            "doc": False,
        },
    },
    deps = [
        "fbsource//third-party/rust:chrono",
        ":context",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
    ],
)
